﻿namespace FSpec.Runner

open Gallio.Model.Helpers
open FSpec.Runner.Model

///Manages test exploration and execution        
type SpecDriver() =
    inherit SimpleTestDriver() with
        override this.FrameworkName = StringResources.FrameWorkName 
        override this.CreateTestController() = 
                new DelegatingTestController( fun test ->
                    let controller = 
                        match test with
                        | :? Specification 
                        | :? Concern
                        | :? Context
                        | :? FSpecAssembly ->
                            new SpecController()
                        | _ -> null
                    controller :> TestController
                ) :> TestController
                
        override this.CreateTestExplorer() = new SpecExplorer() :> TestExplorer


